<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      layout:decorator="layout">
<head>
    <title>118，我给母校发红包</title>
</head>
<body>
<section layout:fragment="content">
<!--/*@thymesVar id="picUrl" type="java"*/-->
 <div style="text-align: center;font-size: 1.2rem;margin-top:2rem;">北京大学教育基金会</div>
<img id="qrcodepay" style="vertical-align: middle;display: block;margin: 1rem auto 1rem;width:16rem; height:16rem" src="${picUrl}" th:src="@{'/peking/prepay/qrcode/img?url='+ ${picUrl}}"/>
<div style="text-align: center;font-size: 1.2rem">长按二维码完成支付</div>
<script src="/static/js/jquery-1.12.1.min.js" th:src="@{/static/js/jquery-1.12.1.min.js}"/>
<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>


<script th:inline="javascript">
  //windows.location.href=/*[[${picUrl}]]*/'';
function showUnreadNews() {


  $(document).ready(function() {
      var tid = /*[[${tid}]]*/'';
      var  data = {"tid":tid};
      var callId = /*[[${callId}]]*/'';
      $.ajax({
          type: "POST",
          url: "/peking/prepay/qrcode/wxpay/isFinish",
          contentType: 'application/json',
          data:JSON.stringify(data),
          success: function(msg) {
              if( msg.code=="success"){
                  window.location.href = "/peking/pay/success?callId="+callId;
              }else if(msg.code=="failed"){
//                  window.location.href = "${ctx}/user/product/pay/failed";
                  alert("支付失败!");
              }else{

              }

          }
      });
  });
}
  setInterval('showUnreadNews()',6000);
</script>
</section>
</body>
</html>